package com.infusionesuci2Pro;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
*
* @author 
* ###### #####  ###### ###### ###### ##   ##  ##### ######  ###   ##    ##
*   ##   ##   # ##     ##     ##     ##   ## #        ##   ##  ## ####  ##
*   ##   #####  #####  #####  #####  ##   ##  ####    ##   ##  ## ## ## ##
*   ##   ##  #  ##     ##     ##     ##   ##      #   ##   ##  ## ##  ####
*   ##   ##   # ###### ###### ##      ####   #####  ######   ##   ##   ###
*/

public class Medicamentos{

	ArrayList<Medicamento> medicamentos = new ArrayList<Medicamento>();
 	
	public Medicamentos(InputStream txt) {
		
		String m="";
		String []linea;
		try
        {
            BufferedReader brin =new BufferedReader(new InputStreamReader(txt));// se puede agregar depues de txt: , "Cp1252" para que tome el micro
            while((m = brin.readLine())!=null){
            	linea=m.split("#");
            	medicamentos.add(new Medicamento(linea[0], linea[1] , linea[2], linea[3], linea[4], 
            			linea[5], linea[6], linea[7],linea[8],Boolean.parseBoolean(linea[9])));
            }
        }
        catch(Exception exception){
        	
        }
	}

	public ArrayList<Medicamento> getMedicamentos() {
		return medicamentos;
	}

	public void setMedicamentos(ArrayList<Medicamento> medicamentos) {
		this.medicamentos = medicamentos;
	}
}